#ifndef						ARBITRE_HH_
# define					ARBITRE_HH_

# include					<map>
# include					<utility>
# include					<vector>
# include					"Arbitre.hpp"
# include					"Square.hpp"
# include					"Macro.hpp"

class 						Arbitre
{
private:
	//						Attributes
	std::map<int, Square*>	&_map;
	std::map<int, int*>		_directionCoords;
	char					_win;
	bool					_color;
	bool					_doubleThreeRule;
	bool					_breakableFiveRule;

public:					
	//						Ctor-Dtor
	Arbitre(std::map<int, Square*> &map, bool doubleThreeRule, bool breakableFiveRule);
	~Arbitre();

	//						Functions
	void					init( int direction, int first, int second);
	bool					breakableFive(int key);
	void					checkForWinner(int &deadStone, bool color);
	bool					winState(char stonePattern, char colorPattern, char colorMask);
	bool					ruleOfThree(char stonePattern, char colorPattern, char colorMask, char colorMask2, int i);
	void					takeState(int key, char stonePattern, char colorPattern, int &deadStone, int direction, char colorMask);
	void					takeStateManager(int key, char stonePattern, char colorPattern, int &deadStone, int direction, char colorMask);
	void					ruleManager(char stonePattern, char colorPattern, char colorMask1, char colorMask2, int i);
	void					removeStone(int key, int direction);
	char					swapBit(char bit);
	char					purifyByte(char byte, int limit);
	int						check(int key, Box infoMap, int &deadStone, bool color);

	//						Getters
	char					getWin();
};

#endif